Computer Programing I in Visual Basic --- CS602 --- Daily Assignments for 3rd Quarter





Tuesday 3/30/10
Objective:
Create menus for programs and message boxes to help users who have entered invalid data, to make the programs more versatile and user-friendly.


Do Now:
Paper and Pencil:
Handout: Menu Editor Do Now


Assignment:

Program: Finish the Cereal.frm with a menu and invalid data messages.
Paper and Pencil: Finish Cereal Questions.

Ticket out the Door:
On your Menu Editor Do Now paper, tell what you think the left and right arrows in the menu editor window might be used for.
Turn in papers.
Upload programs to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.



Monday 3/29/10

Objective:
Create menus for programs to make them more versatile and user-friendly.


Do Now:
Paper and Pencil:
Page 1 of the Cereal Questions packet.


Assignment:

Do the parts of the assignment in THIS order.

Paper and Pencil:
Pages 2 and 3 of the Cereals Questions packet.

Program:
Revise the Cereal.frm program by using the directions in you notebook.
Cereal with a Menu and Invalid Data Messages

Paper and Pencil:
Pages 4 and 5 of the Cereal Questions packet.
Test your Cereal.frm program thoroughly.


Ticket out the Door:
Paper and Pencil: Finish and turn in the Cereal Questions.



Friday 3/26/10

Objective:
Create menus for programs to make them more versatile and user-friendly.


Do Now:
Paper and Pencil:
1.
What is one reason for having a menu in a program?

2. What are the 8 menu items at the top of Visual Basic?

3. What are the 9 menu items in Microsoft Word?


Assignment:

Program: FreefallMenu.frmFreeFall.PNG
Directions are in you notebook.
Use your most recent version of Freefall from your Gaggle digital locker.
If you don't have one, make a new form.
Program: ClassMenu.frm
Add a menu to your Class.frm program.

Ticket out the Door:
Paper and Pencil: While you are in FreefallMenu.frm, get into the menu editor.
Do you think you can make adjustments to the menu after you have created it?
By looking at it, what do you think you can do?


Wednesday & Thursday 3/24, 25/10
Objective 1:
Create a program that accepts a student's last name, first name, middle initial, and grade. Trim and concatenate the parts of the name. Output the correct string literal: freshman, sophomore, junior, or senior, based on the grade. Give corrective error messages for bad data.
Objective 2:
Work well with a partner who you did not pick to make the best program you can that successfully runs and produces correct output for all test data.


Do Now:
Paper and Pencil:
1.
Which of these is not a synonym of concatenate?
A. connect
B. attach
C. join
D. make several into one
E. eliminate

2. What does the Trim function do?
A. Removes leading or trailing spaces.
B. Puts tinsel on the tree.
C. Adds color to the textbox.
D. Abbreviates words.


Assignment:

Program: Class.frm
You will work on this program with a partner who you pick through a random drawing.
Start with one person creating the form while the other reads the directions and starts planning.
Put both names in the form caption.

Ticket out the Door:
Paper and Pencil: On the same paper as you Do Now
Tell what progress you made on the Class.frm program.

Tuesday 3/23/10
Do Now:
Program:
Concatenation.frm
Make It Better:
Add the Trim function so that users who accidentally type spaces before or after the first or last names will have them removedTrimFunction.PNG.


Assignment:

Program: ModeTrans.frm
Look at sample programs in Scratch.

Ticket out the Door:
Upload programs to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.



Monday 3/22/10
Do Now:
Think - Pair - Share
Which of these lines of code is the best for catching a password that was not confirmed correctly?
a) If Len(Password) <> Len(Confirm) Then
b) If UCase(Password) <> UCase(Confirm) Then
c) If Password <> Confirm Then
Why?


Assignment:

Paper and Pencil: Questions After RegisterJPM.frm

Correct RegisterJPM.frm and test thoroughly. Have another student test yours and vice versa.
Invalid data must be caught and given an appropriate error message.
Here are the 7 constraints:


  1. Username too short
  2. Username too long
  3. Username not all lowercase
  4. Password too short
  5. Password too long
  6. Password the same as username (regardless of case)
  7. Confirm not the same as password

If the input for username, password, and confirm are all acceptable, give the message that the person is registered.
See the test data and what the form will look like in the notebook.
Finish back work.
Have programs ready for Miss Hangen to grade.
Look at sample programs in Scratch.

Ticket out the Door:
Turn in the Questions After Register
Upload programs to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.



Friday 3/19/10
Do Now:
Turn in your evaluation rubrics from the computer fair.

Assignment:

Finish RegisterJPM.frm and test thoroughly. Have another student test yours and vice versa.
Invalid data must be caught and given an appropriate error message:
  1. Username too short
  2. Username too long
  3. Username not all lowercase
  4. Password too short
  5. Password too long
  6. Password the same as username (regardless of case)
  7. Confirm not the same as password

If the input for username, password, and confirm are all acceptable, give the message that the person is registered.
See the test data and what the form will look like in the notebook.
Finish back work.
Have programs ready for Miss Hangen to grade.
Look at sample programs in Scratch.

Ticket out the Door:
Upload programs to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.


Thursday 3/18/10
Do Now:
Get the evaluating rubrics for the computer fair.

Assignment:

Evaluate at least 3 exhibits at the computer fair.

Ticket out the Door:
Turn in your evaluation rubrics.

Wednesday 3/17/10
Do Now:


Assignment:

Program: RegisterJPM.frm

Ticket out the Door:
Upload RegisterJPM.frm to your Gaggle digital locker. Delete off the desktop and empty the recycle bin.
Turn in your finished papers.
Tuesday 3/16/10
Assignment:
Program: RegisterJPM.frm

Monday 3/15/10

Do Now:
Paper and Pencil: Questions Prior to Register.frm

Assignment:

Program: RegisterJPM.frm

Ticket out the Door:
Upload RegisterJPM.frm to your Gaggle digital locker. Delete off the desktop and empty the recycle bin.
Turn in your finished papers.

Friday 3/12/10
Program as a Quiz:
- Use this form to fill in the appropriate code which can be found on the Notes on the StrComp Function papers in your notebook and test with the data on the notes pages.
- You may discuss what you are doing with your partner student, but no one else.
- Use your notebook, this website, and Visual Basic only.
- No other websites may be used today.
- If you use another website your grade will be zero.
- To make the program better, include the Trim function.
- When your program is finished, have Miss Hangen check it.


Assignment:
Paper and Pencil: Questions Prior to Register.frm


Ticket out the Door:
Turn in your finished papers

Thursday 3/11/10
Do Now:
Paper and Pencil:
1. Write a line of code to determine how many characters in the string variable Username.
2. Write an If Then that will determine if the number of characters in the string variable Username is a number from 4 to 15.
3. True or False: Usernames are usually case-insensitive.
4. True of False: Passwords are usually case-sensitive.


Assignment:
Paper and Pencil: Questions Prior to Register.frm


Ticket out the Door:
Turn in your finished papers.

Wednesday 3/10/10

Assignment:

Finish AlphaAnimals.frm

Tuesday 3/9/10
Do Now:
Paper and Pencil:
Usually usernames for internet services are not case-sensitive; therefore, if you registered with the username, MyUserName, but you typed in myusername the next time you logged in, it would still work.

1. True or False: When the username is case-insensitive, tether123 would be considered a match for Tether123.

Passwords for internet services are always case-sensitive; therefore, if you made you password, MyPassword5, but you typed in mypassword5 the next time you tried to log in, it would tell you the password is in invalid.

2. True or False: When the password is case-sensitive, escapehatch would NOT be considered a match for EscapeHatch.

One way to compare strings that do not need to be case sensitive is to make the characters all the same case then compare.

3. True or False: LCase("Tether123") = LCase("tether123")

4. True or False: LCase("BiBiCiC") = LCase("biBiCici")

To check if a password match is correct check that they are exactly equal.

5. True or False: "qwpoGH" = "gwp0GH"


Assignment:

Another way that Visual Basic uses to make string comparisons is the StrComp( ) function. Read about it in your notebook.
Read: Notes on the StrComp Function on pages 1 to 4 in the back of your notebook.
Paper and Pencil: StrComp Function Questions
Program: AlphaAnimals.frm

Ticket out the Door:
Turn in the StrComp Function Questions.

Monday 3/8/10
Do Now:
Paper and Pencil:
1. What does uppercase mean?
2. What does lowercase mean?
3. What does case-sensitive mean?
4. What does case-insensitive mean?


Assignment:
Program: Case.frm

Read: Notes on the StrComp Function on pages 1 to 4 in the back of your notebook.

Ticket out the Door:
Upload Case.frm to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.

Finish back assignments.

Friday 3/5/10
Finish back work.
Use your Quality Check Off Sheet.


Thursday 3/4/10

Do Now:
Finish StringLength.frm

Assignment:
Program: StringComp.frm
Paper and Pencil: String Comparison Part 1 Questions
These questions must be done prior to revising to StringComp2; otherwise the answers will not be correct.

Program: StringComp2.frm (additions to StringComp.frm)
Paper and Pencil: String Comparison Part 2 Questions


Ticket out the Door:
Upload StringComp2.frm to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.

Turn in String Comparison Part 1 Questions
Turn in String Comparison Part 2 Questions

Wednesday 3/3/10

Do Now:
Read about the string functions on pages 2 and 3 of More String Notes with String Functions and ASCII Codes.
String Functions:

-- Len
-- UCase
-- LCase
-- Str
-- Val
-- Chr
-- Trim



Assignments:

Paper and Pencil: Strings Questions with Word Bank Pages 2 and 3 (ASCII codes on page 4 of the notes)
Program: StringLength.frm
Directions in your notebook.

Ticket out the Door:
Turn in your paper.
Upload StringLength.frm to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.


Tuesday 3/2/10
Do Now:
Look at ASCII codes on the More String Notes in your notebook or here to find determine what sentence will be created by translating these ASCII codes into their corresponding letters/characters. Do this on the back of the assignment paper.
87, 105, 108, 108, 32, 119, 101, 32, 103, 101, 116, 32, 109, 111, 114, 101, 32, 115, 110, 111, 119, 32, 111, 114, 32, 83, 112, 114, 105, 110, 103, 63


Assignment:
Read: More String Notes with String Functions and ASCII Codes

Paper and Pencil: Strings Questions with Word Bank Page 1


Ticket out the Door:
Turn in your paper.
Check all your programs from the first half of the 3rd marking period.
Have them available for Miss Hangen to check.

Monday 3/1/10
Do Now:
Read the More String Notes with String Functions and ASCII Codes in your notebook or here.


Assignment:
Program: StringExample.frm
Directions in your notebook.


Ticket out the Door:
Upload StringExample.frm to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.


Friday 2/26/10

Snow & Wind Day -- No School


Thursday 2/25/10
Do Now:

Test your Fence.frm program with all the test data in the notebook.

Assignment:
Trade seats with your program testing partner, to test your partners Fence.frm program.
Have you partner test your program thoroughly.
Make changes as necessary.

Ticket out the Door:
Paper and Pencil:
Describe 3 similarities between the Paint program and the Fence program.

Upload Fence.frm to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.



Wednesday 2/24/10
Do Now:

Look at pages 1-3 of the directions for Paint.frm and page 1 of the directions for Fence.frm in your notebook.

Paper and Pencil:

The formula you used for calculating the surface area to be painted in Paint.frm was
SurfaceArea = 2 * Width * Height + 2 * Length * Height + Length * Width.
1. What formula will you use to calculate the perimeter of the fence in Fence.frm?

In Paint.frm you had to buy entire cans of paint.
2. In Fence.frm, what must you buy in whole units?

In Paint.frm the contents of a can of paint would cover 400 sq ft.
3. In Fence.frm, how long is a section of fence?

In Paint.frm you multiplied the cost of a gallon can of paint by the number of cans needed to find the total cost of paint.
4. In Fence.frm, what will you multiply to find the total cost for all the sections of fencing needed?

5. True or False: You can use the comparable concepts from Paint.frm as a guide for doing Fence.frm as long as you make the appropriate adjustments.

Assignment:
Program: Fence.frm Save to the desktop.
Directions in the notebook. No code provided. Read the directions carefully.

Ticket out the Door:
Turn in your Do Now.
Upload Fence.frm to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.



Tuesday 2/23/10
Do Now:
Run your Paint.frm program. Enter the answers your program outputs for the data in this Google form.


Assignment:
Paper and Pencil: Paint.frm Questions
Program: Fence.frm

Ticket out the Door:
Turn in Paint.frm Questions.
Finish back assignments and upload to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.




Monday 2/22/10
Check your Gaggle email.
Finish work from Thursday and Friday. See below.

Friday 2/19/10
Do Now:

Run your Turkey.frm program. Enter the answers your program gave for the data in this Google form.


Assignment:
Program: Paint.frm
Look over all 7 pages of directions in the notebook before starting to create the program.
Test thoroughly yourself.
Have your partner test yours and you test your partners.
Improve as necessary and test again.

Ticket out the Door:
Upload to your Gaggle digital locker.
Delete from the desktop.
Empty the recycle bin.


Thursday 2/18/10
Do Now:

Finish Convert Seconds Questions and put them in the quiz form on the wiki entry for yesterday.

Assignment:
Program: Turkey.frmTurkey.PNG
Read all 4 pages of directions in the notebook before starting to create the program.
There is an explanation before you get to the actual code that you will type.
Test thoroughly yourself.
Have your partner test yours and you test your partners.
Improve as necessary and test again.

Ticket out the Door:
Finish back programs such ConvertSeconds.frm, Remainder.frm, ChirpsBD.frm, ConeArea.frm
Upload all changed programs to your Gaggle digital locker.
Delete programs off the desktop.
Empty the recycle bin.


Wednesday 2/17/10
Do Now:

Finish ConvertSeconds.frm

Assignment:
Paper and Pencil: Convert Seconds Questions

Have your notebook open to the code for the ConvertSeconds.frm program. Refer to this code and the comments about the code while answering the questions. Also have your ConvertSeconds.frm program ready to run to answer some of the questions. Do the assignment on paper first, and then transfer your answers to the computer. Try to get the best score you can the first time. To improve your score, look over the code in the notebook, correct your answer on paper and retake the quiz on the computer. Make sure you put your first name and last name in the name box of the quiz, so you get credit for it.



Ticket out the Door:
Finish back programs such as ChirpsBD.frm and Remainder.frm

Tuesday 2/16/10
Do Now:
Paper and Pencil:
Division Examples:

Study this code and the results, and then use what you know about, /, \, Mod, Single, Integer to calculate the following answers. You may use a calculator.

Division.PNG
Use 124 for the first number and 5 for the second number.
1. What will be the message box output for line 3 of the code?
2. What will be the output for line 6 of the code?
3. What will be the result for line 9 of the code?
4. What will appear in the message box for line 12 of the code?
5. Which symbol is used for regular division?
6. Which symbol is used to calculate the integer part of a division?
7. What key word is used to calculate the remainder of integer division?
8. What data type must be used for the answer to a division problem to show its decimal values?
9. What data type is used to round the answer to a division problem to the nearest integer?


Assignment:
Program: ConvertSeconds.frm

Include the comments when you type the code. Directions in notebook.
Have your partner test yours and you test your partners.

Ticket out the Door:
Show it to Miss Hangen after is has been tested by both you and your partner and all improvements have been made.
Upload to your Gaggle digital locker.


Tuesday 2/9/10
Do Now:
Think - Pair - Share:

What is different about \ division compared to / division?
What is calculated with the Mod operator?
Try Miss Hangen's RemainderCalculator.exe
Assignment:
Program: Remainder.frm

Create your own remainder calculator that looks nicer than the one we tried out a few days ago.
Make It Better:
After you know that your program calculates the integer quotient and the remainder correctly, make it better by including the KeyPress procedure, checks for IsNumeric, and a check of bad numeric data.
Test Data:
Dividend = 35, Divisor = 4 --> 8 R 3
Dividend = 927, Divisor = 0 --> Can't divide by zero. Change the divisor (denominator).
Dividend = 0, Divisor = 16 --> 0 R 0
Dividend = 7, Divisor = 49 --> 0 R 7
Dividend = 64, Divisor = 12 --> 5 R 4
Dividend = a;ldkfj, Divisor = 23 --> Use numerals.
Dividend = 876, Divisor = garbage --> Use numerals.
Dividend = -333, Divisor = -17 --> 19 R -10

Ticket out the Door:
Upload to your Gaggle digital locker.


Monday 2/8/10
Go over work from Friday.

Friday 2/5/10
Do Now:
Read:

Let's talk about integer division in computer science. When you are using integers and would like integer results when dividing, there are some things you need to know. Division which results in a possible decimal answer uses the slash symbol as its operator. The slash symbol, /, is found on the same key as the ? on the keyboard. When you need to divide integers and get the quotient as just the integer part of the answer, you must use the back slash, \, which is found on the key above the Enter key. Since you might also need the remainder, you will need a second division using the modulus operator, which is the keyword Mod in Visual Basic. When you use Mod as the operator, the result is the integer remainder of the division problem.

Math Example:
35 / 4 has a quotient of 8.75 or 8 and 3/4
35 \ 4 has an integer quotient, which is 8
35 Mod 4 has an integer remainder which is 3

Visual Basic Example:
Quotient = Dividend / Divisor 'decimal answer
IntegerQuotient = Dividend \ Divisor 'integer answer, if there would be a decimal it is chopped off, number is not rounded
Remainder = Dividend Mod Divisor 'result is the integer remainder that could be calculated through long division

Assignment:
Program: Remainder.frm

Create your own remainder calculator that looks nicer than the one we tried out a few days ago.
The user will input the dividend and the divisor.
Your program will display as output, the integer quotient and the remainder.
Make up your own test data and verify that your program gives the same results as the quotient and remainder calculator at
http://www.analyzemath.com/Calculators_3/quotient_remainder.html
Also test these: Dividend = 35, Divisor = 4
Dividend = 927, Divisor = 0
Dividend = 0, Divisor = 16
Dividend = 7, Divisor = 49
Dividend = 64, Divisor = 12

Make It Better:
After you know that your program does this much correctly, make it better by including the KeyPress procedure, checks for IsNumeric, and a check of bad numeric data.

Ticket out the Door:
Upload to your Gaggle digital locker.

Thursday 2/4/10

Do Now:
Read:
Read the front and back of the handout titled, Fewer High School Students Taking Computer Science Classes.

Assignment:
Write on paper or type in Microsoft Word:

1. Summary of article
2. How this relates to you
3. What you would say in a blog post.

Ticket out the Door:
Turn in your hand-written paper or save your Word document as CSclassesArticle.doc and upload it to your Gaggle digital locker.

Wednesday 2/3/10
Do Now:

Paper and Pencil: If a DVD says that a movie is 176 minutes long, how many hours and minutes is that?

Read these webpages to study up on long division and finding a remainder.
http://www.mathsisfun.com/long_division2.html
http://en.wikipedia.org/wiki/Long_division
http://www.homeschoolmath.net/teaching/md/remainder.php
http://demonstrations.wolfram.com/LongDivision/


Assignment:
Paper and Pencil:
Do the long division to find the quotient and remainder. NO DECIMALS
1. 271 / 60
2. 34 / 7
3. 17 / 12
4. 7895 / 5280
5. 88 / 3
6. 12345 / 52


Ticket out the Door:
Paper and Pencil: Give some examples of when you think you might need to use the quotient and the remainder instead of a decimal number?




Tuesday 2/2/10

Do Now:
Find your previous version of Chirps.frm in your Gaggle digital locker. Save it to the desktop. Open it and test it. If you cannot find it use this form.
external image plain.png ChirpsBD.frm
Assignment:
Program:
Add code to Chirps.frm according to the directions in your notebook.
Ticket out the Door:
Have your partner check your program and you check your partner program.
Improve as necessary.
Upload ChirpsBD.frm to Gaggle digital locker.

Monday 2/1/10

Do Now:
Paper and Pencil:
Create Your Own Test Data for These Geometry Formulas: Surface Area of a Sphere

Assignment:
Program
: SphereError.frm
This program has already been created but contains lots of errors that you must fix.
See the notebook for directions

Test your partners program.
Have your partner test your program.
Improve your program.

Ticket out the Door:
Upload the corrected program SphereArea.frm to your Gaggle locker.




Thursday 1/28/10

Do Now:
Find the syntax for raising to a power and the syntax for taking the square root by looking at the AssignSyntaxNotes.doc in the black notebook or looking at the file.
  1. Write the symbol for raising to a power in Visual Basic
  2. Where is it located on the keyboard?
  3. What is the name of the symbol? a) arrow up b) carrot c) caret or circumflex d) tilde e) ampersand http://www.ascii.cl/htmlcodes.htm
  4. Write the function for taking the square root in Visual Basic
  5. Write the formula for the surface area of an open cone in the proper Visual Basic syntax when these declarations statements are included in the program.
ConeDeclaration.PNG

Assignment:
Program
: ConeArea.frm
Test your partners program.
Have your partner test your program.
Improve your program.

Ticket out the Door:
Explain what the outer If Then Else does.
Explain what the nested If Then Else does.

Extra Credit:
Make a similar program for a geometric figure that we have not used yet.



Tuesday & Wednesday 1/26, 27/10


Do Now:
Find the formula for the surface area of a cone and write it on the assignment sheet.
Paper and Pencil: Create Your Own Test Data for These Geometry Formulas: Surface Area of a Cone
GeoFormulaSheet.JPG
Assignment:
Program: Directions for ConeArea.frm are in the black notebook.
Trade places with your partner and check each other's programs. Make sure to test tab order, Enter, spelling, good data, bad data.
Improve your program as appropriate.

Ticket out the Door:
Extra Credit:
Make a similar program for a geometric figure that we have not used yet.


First marking period assignments can be found at QT1.
Second marking period assignments can be found at QT2.